@extends('admin.public')

@section('content')
    <div class="col-md-12">
        <section class="panel panel-default text-sm doc-buttons">
            <div class="panel-body">
                <a href="{{ route('admin.friendlylink.friendlylink_add') }}" class="btn btn-info"><i
                            class="icon-plus ico"></i>
                    &nbsp; 添加友情链接</a>
            </div>
        </section>
    </div>

    <div class="col-md-12">
        <section class="panel panel-default">
            <header class="panel-heading">
                {{ $frame['title'] }}
            </header>
            <table class="table table-striped m-b-none">
                <thead>
                <tr>
                    <th class="col-md-3">友情链接</th>
                    <th class="col-md-3">编辑时间</th>
                    <th class="col-md-3">作者</th>
                    <th class="col-md-3">操作</th>
                </tr>
                </thead>
                <tbody>
                @if(!empty($friendlyLinks))
                    @foreach( $friendlyLinks as $friendlylink )
                        <tr>
                            <td>
                                <a class="m-r"
                                   href="{{ route('admin.friendlylink.friendlylink') }}?status={{ $friendlylink->id }}">
                                    @if( (bool)$friendlylink->status )
                                        <i class="fa-tags fa text-xs text-ff552e text-center-xs"
                                           title="友情链接开启"></i>
                                    @else
                                        <i class="fa-tags fa text-xs text-no text-center-xs"
                                           title="友情链接关闭"></i>
                                    @endif
                                </a>
                                <a href="{{ $friendlylink->url }}" target="_blank"
                                   class="text-info">{{ $friendlylink->name }}</a>
                                @if(!empty( $friendlylink->image ))
                                    <small class="text-small">
                                        ( 图标:
                                        <img src="{{ $friendlylink->image }}" alt="{{ $friendlylink->name }}"
                                             style="height: 12px;"> )
                                    </small>
                                @endif
                            </td>
                            <td>{{ $friendlylink->updated_at }}</td>
                            <td>{{ $friendlylink->author }}</td>
                            <td>
                                <a href="{{ route('admin.friendlylink.friendlylink_edit',$friendlylink->id) }}"
                                   class="btn btn-xs btn-default">编辑</a>
                                <a href="{{ route('admin.friendlylink.friendlylink') }}?del={{ $friendlylink->id }}"
                                   class="btn btn-xs btn-danger">删除</a>
                            </td>
                        </tr>
                    @endforeach
                @else
                    <tr>
                        <td colspan="4" align="center">暂无友情链接,请<a
                                    href="{{ route('admin.friendlylink.friendlylink_add') }}"
                                    class="text-info">添加友情链接</a>!
                        </td>
                    </tr>
                @endif
                </tbody>
            </table>
        </section>
    </div>
@endsection

@section('css')
@endsection

@section('js')
@endsection